<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="sdfi.lee.Entity.Lab"%>
<%@page import="sdfi.lee.DAO.LabDAO"%>
<%@page import="java.util.List"%>
<html>
<head>
<meta name="location" content="<a href='<c:url value='/enterprise/lablist.jsp?pg=1' />'>
			国家重点实验室
			</a>">
<link rel="stylesheet" href="../css/index.css" />
<link rel="stylesheet" href="../css/level.css" />
<script type="text/javascript" src="../js/jquery-1.6.js" ></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
$(function(){

	$('div td:nth-child(odd)').css("width","30%");
});
</script>
</head>
<body>
<%
List<Lab> list=new LabDAO().getAllLab(Integer.valueOf(request.getParameter("pg")),20);
request.setAttribute("list",list);
%>
<c:forEach items="${requestScope.list}" var="lab">
				<c:url value="/enterprise/labdetail.jsp?lid=${lab.id}&pg=${param.pg}" var="lpath"></c:url>
				<div class="epitem">
					
				<table width="100%">
				<tr>
					<td style="width:20%;text-align:left">
						<c:choose>
							<c:when test="${fn:length(lab.ppath)>0}">
								<a href="${lpath}"><img src="<c:url value='${lab.ppath}' />"></a>
							</c:when>
							<c:otherwise>
								<a href="${lpath}"><img src="<c:url value='/image/nopic.gif' />" title="暂无图片"></a>
							</c:otherwise>
						</c:choose>
					</td>
					<td>
						<a href="${lpath}">${lab.labname}</a>
					</td>
				</tr>
				</table>
				</div>				
				</c:forEach>
					<div style="clear:left;"></div>
				 <div id="pages">
                	
         	
                每页<span>20</span>条,第<span>${param.pg}</span>页,该页
                	<span>${fn:length(requestScope.list) }</span>条
                    <c:choose>
                		<c:when test='${param.pg==null||param.pg==""||param.pg==1}'>
                			上页
                		</c:when>
                		<c:otherwise>
                			<c:url value='/enterprise/lablist.jsp?etype=${param.etype}&pg=${param.pg-1}'  var="down"/>
                			 <a href="${down}">上页</a>
                		</c:otherwise>
                	</c:choose>
                	
                   	<c:choose>
                   		<c:when test="${fn:length(requestScope.list)<20}">
                   			下页
                   		</c:when>
                   		<c:otherwise>
                   		<a href="<c:url value='/enterprise/lablist.jsp?etype=${param.etype}&pg=${param.pg+1}' />">下页</a>
                   		</c:otherwise>
                   	</c:choose>
                    
                </div>
</body>
</html>